package legumes.client.ui.widgets.window;

import com.google.gwt.maps.client.control.LargeMapControl;
import com.google.gwt.maps.client.control.MapTypeControl;
import com.google.gwt.maps.client.control.ScaleControl;
import com.google.gwt.maps.client.geom.LatLng;
import com.smartgwt.client.widgets.events.CloseClickHandler;
import com.smartgwt.client.widgets.events.CloseClientEvent;

public class MaximizedStoreWindowMap extends StoreMapWindow {
	
	public MaximizedStoreWindowMap(LatLng center_){
		super(	com.google.gwt.user.client.Window.getClientWidth(),
				com.google.gwt.user.client.Window.getClientHeight(), 
				center_ );
		setShowCloseButton(true);
		setShowMaximizeButton(false);
		
		addCloseClickHandler(new CloseClickHandler() {
			
			@Override
			public void onCloseClick(CloseClientEvent event) {
				onCloseAction();
			}
		});
	}
	
	protected void onCloseAction(){
		MaximizedStoreWindowMap.this.setVisible(false);
	}
	
	@Override
	protected void initWindowProperties() {
		super.initWindowProperties();
		setShowMinimizeButton(false);
	}

	@Override
	protected void initMapControls(){
		getMapWidget().addControl(new LargeMapControl());
		getMapWidget().addControl(new MapTypeControl());
		getMapWidget().addControl(new ScaleControl());
	}
	
}
